package com.ruoyi.web.controller.system;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.MeetingCollectUser;
import com.ruoyi.system.service.IMeetingCollectUserService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 会议收集人员Controller
 *
 * @author ruoyi
 * @date 2024-04-04
 */
@RestController
@RequestMapping("/system/collect/user")
public class MeetingCollectUserController extends BaseController
{
    @Autowired
    private IMeetingCollectUserService meetingCollectUserService;

    /**
     * 查询会议收集人员列表
     */
    @PreAuthorize("@ss.hasPermi('system:user:list')")
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody MeetingCollectUser meetingCollectUser)
    {
        List<MeetingCollectUser> list = meetingCollectUserService.selectMeetingCollectUserList(meetingCollectUser);
        return getDataTable(list);
    }
//
//
//    /**
//     * 获取会议收集人员详细信息
//     */
//    @PreAuthorize("@ss.hasPermi('system:user:query')")
//    @GetMapping(value = "/{id}")
//    public AjaxResult getInfo(@PathVariable("id") Long id)
//    {
//        return success(meetingCollectUserService.selectMeetingCollectUserById(id));
//    }

//    /**
//     * 新增会议收集人员
//     */
//    @PreAuthorize("@ss.hasPermi('system:user:add')")
//    @Log(title = "会议收集人员", businessType = BusinessType.INSERT)
//    @PostMapping
//    public AjaxResult add(@RequestBody MeetingCollectUser meetingCollectUser)
//    {
//        return toAjax(meetingCollectUserService.insertMeetingCollectUser(meetingCollectUser));
//    }

    /**
     * 上传收集资料
     */
    @PreAuthorize("@ss.hasPermi('system:user:edit')")
    @Log(title = "会议收集人员状态", businessType = BusinessType.UPDATE)
    @PutMapping("/edit")
    public AjaxResult edit(@RequestBody MeetingCollectUser meetingCollectUser)
    {
        meetingCollectUser.setCreateBy(String.valueOf(getUserId()));
        return toAjax(meetingCollectUserService.updateMeetingCollectUser(meetingCollectUser));
    }

//    /**
//     * 删除会议收集人员
//     */
//    @PreAuthorize("@ss.hasPermi('system:user:remove')")
//    @Log(title = "会议收集人员", businessType = BusinessType.DELETE)
//	@DeleteMapping("/{id}")
//    public AjaxResult remove(@PathVariable Long id)
//    {
//        return toAjax(meetingCollectUserService.deleteMeetingCollectUserById(id));
//    }
}
